package org.kernely.ui.utils;

import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.Notification;

/**
 * Vaadin tray notification, customized for Kernely.
 * Please use this notification instead of Vaadin notification.
 */
public class KernelyNotification extends Notification {
	
	public static final String ERROR_ICON = "img/error_icon16x16.png";
	public static final String WARNING_ICON = "img/warning_icon16x16.png";
	public static final String INFO_ICON = "img/info_icon16x16.png";
	public static final String ASKING_ICON = "img/asking_icon16x16.png";

	/**
	 * Generatid serial ID
	 */
	private static final long serialVersionUID = -4700490474383226335L;
	
	/**
	 * Create a notification, displayed as a tray notification, with an icon.
	 * @param message The message to display
	 * @param icon The icon. Use KernelyNotification static constants.
	 */
	public KernelyNotification(String message, String icon) {
		super(message, Notification.TYPE_TRAY_NOTIFICATION);
		this.setIcon(new ThemeResource(icon));
	}

}
